package cn.tedu.pojo.entity;

import cn.tedu.config.DateTimeConverter;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.math.BigDecimal;
import java.util.Date;


/**
 * 商品货品对象 fz_sku
 *
 * @author kiven
 * @date 2023-02-09
 */
@ExcelIgnoreUnannotated
public class Sku
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private Long id;

    /** 商品表的商品ID */
    @ExcelProperty( "所属品类编号")
    private Long spuId;

    private Long shopId;
    /** 商品规格值列表，采用JSON数组格式 */
    @ColumnWidth(20)
    @ExcelProperty( "商品规格值")
    private String specifications;

    /** 商品货品价格 */
    @ExcelProperty("价格")
    //@NotNull(message = "请填写价格")
    private BigDecimal price;

    /** 商品货品数量 */
    @ExcelProperty("数量")
    //@NotNull(message = "请填写数量")
    private Long number;

    /** 商品货品图片 */
    private String url;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ExcelProperty(value = "创建时间",converter = DateTimeConverter.class)
    private Date addTime;

    /** 逻辑删除 */
    //@ExcelProperty( value= "逻辑删除",converter = DeletedConverter.class)
    private Integer deleted;

    @Override
    public String toString() {
        return "Sku{" +
                "id=" + id +
                ", spuId=" + spuId +
                ", shopId=" + shopId +
                ", specifications='" + specifications + '\'' +
                ", price=" + price +
                ", number=" + number +
                ", url='" + url + '\'' +
                ", addTime=" + addTime +
                ", deleted=" + deleted +
                '}';
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getSpuId() {
        return spuId;
    }

    public void setSpuId(Long spuId) {
        this.spuId = spuId;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public String getSpecifications() {
        return specifications;
    }

    public void setSpecifications(String specifications) {
        this.specifications = specifications;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Long getNumber() {
        return number;
    }

    public void setNumber(Long number) {
        this.number = number;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }
}
